<template>
  <div>
<!--    mousewheel-->
    <n-carousel direction="vertical" dot-placement="right" draggable="true" style="width: 100%; height: 740px">
      <template #dots="{ total, currentIndex, to }">
        <ul class="custom-dots">
          <li
              v-for="index of total"
              :key="index"
              :class="{ ['is-active']: currentIndex === index - 1,['is-active-not']: currentIndex !== index - 1 }"
              @click="to(index - 1)"
          ></li>
        </ul>
      </template>
      <div class="relative select-none">
        <img class="carousel-img absolute" :src="bgTab">
        <span class="absolute select-none text-black text-big font-bold img-bold-text">
          中国国家地理官方客户端
        </span>
        <span class="absolute select-none img-text-d">
          兼具世界各地不同区域的自然、人文景观和事件，并揭示其背景和奥秘，另亦涉及天文、生物、历史和考古等领域。
        </span>
        <div class="absolute select-none img-button">
          <n-button color="black" round style="width: 176px;height: 64px;font-size: 18px;font-family: AliHYH">
            立即下载
          </n-button>
        </div>
      </div>
      <div class="relative select-none">
        <img class="carousel-img absolute" :src="secondTab">
      </div>
    </n-carousel>
  </div>
</template>

<script setup lang="ts">

import bgTab from '@/assets/image/bg-tab.jpeg'
import secondTab from '@/assets/image/second-pg.jpeg'
</script>
<style scoped lang="scss">
.carousel-img {
  width: 100%;
  height: 740px;
  object-fit: cover;
  -webkit-user-drag: none;
}

.img-bold-text {
  width: 489px;
  height: 160px;
  left: 120px;
  font-family: Noto Serif SC;
  top: 251px;
}

.img-text-d {
  left: 120px;
  top: 443px;
  width: 432px;
  height: 48px;
  font-family: AliHYH;
  mix-blend-mode: normal;
  color: rgba(61, 61, 61, 1);
  font-size: 14px;
  line-height: 24px;
}

.img-button {
  left: 120px;
  top: 531px;
  mix-blend-mode: normal;
}

.custom-arrow {
  display: flex;
  position: absolute;
  bottom: 25px;
  right: 10px;
}

.custom-arrow button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-right: 12px;
  color: #fff;
  background-color: rgba(255, 255, 255, 0.1);
  border-width: 0;
  border-radius: 8px;
  transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.custom-arrow button:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.custom-arrow button:active {
  transform: scale(0.95);
  transform-origin: center;
}

.custom-dots {
  display: inline-grid;
  margin: 0;
  padding: 0;
  position: absolute;
  left: 90%;
  top: 406px;

}

.custom-dots li {
  margin: 5px;
  display: inline-block;
  width: 10px;
  height: 10px;
  padding: 5px !important;
  border-radius: 10px;
  background-color: rgba(255, 255, 255, 0.4);
  transition: width 0.3s, background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.custom-dots li.is-active {
  background: var(--color-red);
  border: 5px solid white;
}

.is-active-not {
  margin: 10px !important;
}
</style>